package com.egreen.system.service;

import com.egreen.common.pojo.DTO.system.SystemInformationDTO;
import com.egreen.common.pojo.VO.system.GetSystemInformationVO;
import com.egreen.system.dao.SystemInformationDao;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class ISystemInformationServiceTEST {
    @Autowired
    ISystemInformationService SystemInformationService;
    @Autowired
    SystemInformationDao systemInformationDao;


    @Test
    public void test(){
        int uid = 1;
        List<GetSystemInformationVO> systemInformation = SystemInformationService.getSystemInformation(uid);
        System.out.println(systemInformation);
    }

    /**
     *  INSERT INTO tb_system_information ( title, content, user_id, admin_id ) VALUES ( ?, ?, ?, ? )
     *  添加系统信息
     */
    @Test
    public void  addSystemInformation(){
        SystemInformationDTO systemInformation = new SystemInformationDTO();
        systemInformation.setContent("好");
        systemInformation.setAdminId(1);
        systemInformation.setTitle("打");
        systemInformation.setUserId(2);

        SystemInformationService.addSystemInformation(systemInformation);


    }

    /**
     * 删除系统信息
     */
    @Test
    public void deleteSystemInformation(){
        int id = 1;
        SystemInformationService.deleteSystemInformation(id);
    }
}
